const app = getApp();

Page({
  data: {
    winWidth: 0,
    winHeight: 0,
    hidden: false,
    curNav: 1,
    curIndex: 0,
    navList: [
      { id: 1, name: "政务大厅" },
      { id: 2, name: "保险类" },
      { id: 3, name: "证件类" },
      { id: 4, name: "医疗类" },
      { id: 5, name: "资格证书类" },
      { id: 6, name: "上学类" },
      { id: 7, name: "税务类" },
      { id: 8, name: "户口类" }
    ],
    dishesList: [
      //政务大厅
      [
        { name: "养老保险缴费", num: 1, id: 1, img: "../images/oldman.png" },
        { name: "兵役预登记", num: 1, id: 2, img: "../images/army.png" },
        { name: "结婚登记预约", num: 1, id: 3, img: "../images/love.png" },
        { name: "生活水电缴费", num: 1, id: 4, img: "../images/life.png" },
        { name: "落户预约", num: 1, id: 5, img: "../images/famliy.png" },
        { name: "暂住证办理", num: 1, id: 6, img: "../images/house.png" },
        {
          name: "普通话考试\n成绩查询",
          price: 58,
          num: 1,
          id: 7,
          img: "../images/chinese.png",
        },
        { name: "银行卡挂失", num: 1, id: 8, img: "../images/bankcard.png" },
      ],
      //保险类
      [
        { name: "养老保险缴费", num: 1, id: 3, img: "../images/oldman.png" },
        { name: "医疗保险缴费", num: 1, id: 4, img: "../images/covid.png" },
        {
          name: "城乡居民养老保险参保",
          num: 1,
          id: 4,
          img: "../images/baoxian.png",
        },
        {
          name: "养老保险待遇查询",
          num: 1,
          id: 4,
          img: "../images/oldman.png",
        },
      ],
      //证件类
      [
        { name: "身份证补办预约", num: 1, id: 5, img: "../images/idcard.png" },
        {
          name: "机动车驾驶证补办预约",
          num: 1,
          id: 6,
          img: "../images/driveslicense.png",
        },
        { name: "户口本补办预约", num: 1, id: 7, img: "../images/house.png" },
        {
          name: "护照办理预约",
          num: 1,
          id: 8,
          img: "../images/passportbook.png",
        },
      ],
      //医疗类
      [
        { name: "社保补缴", num: 1, id: 9, img: "../images/shebao.png" },
        { name: "医疗保险办理", num: 1, id: 10, img: "../images/hospital.png" },
        {
          name: "医院窗口云缴费",
          num: 1,
          id: 11,
          img: "../images/hospital-icon.png",
        },
      ],
      //资格证书类
      [
        {
          name: "普通话等级证书查询",
          num: 1,
          id: 12,
          img: "../images/chinese.png",
        },
        {
          name: "教师资格证书查询",
          num: 1,
          id: 13,
          img: "../images/teacherlicense.png",
        },
        {
          name: "道路运输资格证书查询",
          num: 1,
          id: 14,
          img: "../images/daolu.png",
        },
      ],
      //上学类
      [
        { name: "学籍信息查询", num: 1, id: 15, img: "../images/xueji.png" },
        {
          name: "普通高等学校录取查询",
          num: 1,
          id: 16,
          img: "../images/schoolbuilding.png",
        },
        {
          name: "普通中等职业学校录取查询",
          num: 1,
          id: 17,
          img: "../images/school.png",
        },
        {
          name: "高等院校毕业证书查询",
          num: 1,
          id: 18,
          img: "../images/biye.png",
        },
        { name: "学位证书查询", num: 1, id: 19, img: "../images/xuewei.png" },
      ],
      //税务类
      [
        { name: "税务发票查询", num: 1, id: 20, img: "../images/tax.png" },
        { name: "发票报销", num: 1, id: 21, img: "../images/wenjian.png" },
        { name: "发票验真", num: 1, id: 22, img: "../images/check.png" },
        {
          name: "发票登记",
          num: 1,
          id: 23,
          img: "https://z1.ax1x.com/2023/12/13/pifaNQO.png",
        },
      ],
      //户口类
      [
        { name: "户口本查询", num: 1, id: 24, img: "https://s11.ax1x.com/2023/12/13/pifctUS.png" },
        { name: "户口迁移", num: 1, id: 25, img: "https://s11.ax1x.com/2023/12/13/pifgkGQ.png" },
        { name: "户口登记", num: 1, id: 26, img: "https://s11.ax1x.com/2023/12/13/pifgExs.png" },
        { name: "户口注销", num: 1, id: 27, img: "https://s11.ax1x.com/2023/12/13/pifgJMR.png" },
        { name: "户口变更", num: 1, id: 28, img: "https://s11.ax1x.com/2023/12/13/pifgYs1.png" },
      ],
    ],
    dishes: [],
  },

  selectNav(event) {
    const { id, index } = event.target.dataset;
    this.setData({
      curNav: id,
      curIndex: index,
    });
  },

  onLoad() {
    wx.getSystemInfo({
      success: (res) => {
        this.setData({
          winWidth: res.windowWidth,
          winHeight: res.windowHeight,
        });
      },
    });
  },
});
